package demo2;

/**
 * @Author 12629
 * @Description：
 */
//抽象类
abstract class Shape {
   /* public Shape() {

    }
    static {

    }
    {

    }*/
    //抽象方法
    public abstract void draw();
}

class Rect extends Shape {

    @Override
    public void draw() {
        System.out.println("画一个矩形");
    }
}
class Flower extends Shape {
    @Override
    public void draw() {
        System.out.println("画一朵花！");
    }
}
public class Test {
    public static void drawMap(Shape shape) {
        shape.draw();
    }

    public static void main(String[] args) {
        drawMap(new Flower());
        drawMap(new Rect());
    }
}
